Combination of Machine Learning Techniques to Predict Overweight/Obesity in Adults

(1) Background: Artificial intelligence using machine learning techniques may help us to predict and prevent obesity. The aim was to design an interpretable prediction algorithm for overweight/obesity risk based on a combination of different machine learning techniques. (2) Methods: 38 variables related to sociodemographic, lifestyle, and health aspects from 1179 residents in Madrid were collected and used to train predictive models. Accuracy, precision, and recall metrics were tested and compared between nine classical machine learning techniques and the predictive model based on a combination of those classical machine learning techniques. Statistical validation was performed. The shapely additive explanation technique was used to identify the variables with the greatest impact on weight gain. (3) Results: Cascade classifier model combining gradient boosting, random forest, and logistic regression models showed the best predictive results for overweight/obesity compared to all machine learning techniques tested, reaching an accuracy of 79%, precision of 84%, and recall of 89% for predictions for weight gain. Age, sex, academic level, profession, smoking habits, wine consumption, and Mediterranean diet adherence had the highest impact on predicting obesity. (4) Conclusions: A combination of machine learning techniques showed a significant improvement in accuracy to predict risk of overweight/obesity than machine learning techniques separately.


Introduction
According to the data reported by the Spanish National Institute of Statistics, in the last 30 years, the prevalence of obesity in Spain has been multiplied by 2.4, changing from 7.4% in 1987 to 17.4% in 2017 [1].This increased overweight/obesity prevalence is currently considered as global epidemic, which constitutes an important public health problem [2].According to the World Health Organization, overweight is defined as a condition of excessive fat deposits, while obesity is a chronic complex disease defined by excessive fat deposits that can impair health.The diagnosis of overweight and obesity is performed by measuring people's weight and height and by calculating their body mass index (BMI): weight (kg)/height 2 (m 2 ).For adults, overweight is a BMI greater than or equal to 25 kg/m 2 and obesity is a BMI greater than or equal to 30 kg/m 2 [3].
A large number of risk factors for overweight/obesity has been widely studied [4].It is widely known that population obesity prevention strategies based on non-specific recommendations for physical activity, healthy diet, and models of healthy social rules have the potential to decrease overweight/obesity levels [5].However, these approaches have not achieved desirable results, suggesting the existence of biological factors closely associated with the risk of overweight/obesity [6].Indeed, the classical risk factors for obesity may be classified into modifiable (lifestyle factors and models of healthy social rules) and non-modifiable (sex and age) categories [7,8].Modifiable and non-modifiable factors should be analyzed together to estimate the risk of developing overweight/obesity.However, it is a significant challenge for researchers and epidemiologists since it is required to use large-scale datasets in which traditional modeling assumptions, such as linearity, lack of multicollinearity, and proportional risk/odds/hazards over time, should not be considered [9].Interestingly, systems based on artificial intelligence and machine learning have been proposed as an appealing alternative approach for building predictive models [10].Artificial intelligence can be defined as the development of systems endowed with intellectual processes typical of human beings, such as reasoning, generalization, improvement through past experiences, and the discovery of meanings [11].Based on different machine learning techniques, several approaches have tried to identify modifiable and non-modifiable risk factors responsible for obesity prevalence variation at the population level [12].In this regard, inactivity, an improper and unhealthy diet, age, sex, hypertension, diabetes, and sociodemographic aspects have been related to overweight/obesity by different studies using artificial intelligence models [13][14][15][16][17].However, available studies have evaluated heterogeneous and a limited number of factors, and there is a lack of studies that attempt to jointly analyze non-modifiable biological aspects and modifiable aspects related to lifestyle and health status closely related to obesity using artificial intelligence models.In addition, recent studies have proposed different machine learning methods to predict obesity, in which variables, such as height, weight, and even body mass index, were included as inputs in the datasets of predictive models, thus limiting the predictive power of the proposed models [18,19].
Taking all of these factors together, it is crucial to design optimal predictive models for overweight/obesity without anthropometric measurements that may condition the obvious classification of overweight/obesity with high accuracy.These models would allow us to identify and classify subjects at high risk of developing overweight/obesity in the future, thus enabling us to implement effective preventive risk reduction strategies and, therefore, decreasing the incidence levels of overweight/obesity at the population level.Accordingly, the aim of the present work was to design an algorithm for predicting the risk of overweight/obesity based on different modifiable lifestyle factors and health state as well as non-modifiable biological factors using a cascade classifier flow based on an innovative combination of various classical machine learning algorithms.

Data Source
The present study employed an observational design that collected data from 1179 participants older than 18 years old, who were recruited by 14 recruitment centers, including hospitals and universities in Madrid.Biological and sociodemographic factors as well as aspects related to lifestyle and health state in residents in Madrid (Spain) were anonymously recruited.Different validated questionnaires were administered through a web-based platform.The Mediterranean diet adherence survey (MEDAS test) was used to analyze nutrition habits, while physical activity intensity was analyzed using the International Physical Activity Questionnaire (IPAQ).A total of 38 variables with different categories for each one of them was recorded.Detailed descriptions and categories for these variables are shown in the Supplementary Table S1.
In the inclusion study, all participants accepted and signed an informed consent form.The study was approved by the Regional Clinical Drugs Research Ethics Committee of the Community of Madrid (Comité Ético de la Investigación con Medicamentos Regional de la Comunidad de Madrid CEIm-R, Approval Code: 06/2018.Approval date: 28 June 2018) and conducted in accordance with the Declaration of Helsinki.This project is part of the GenObIA consortium of the Madrid Community (GenObIA-CM.B2017/BMD-3773).

Classical Machine Learning Algorithms and Predictive Model Based on Cascade Classifier Flow
The widely used nine classical machine learning algorithms AdaBoost (ADB), bagging classifier (BC), Bernoulli Naïve Bayes (BNB), decision tree and extra trees (DT and ETs), gradient boosting (GB), Gaussian Naïve Bayes (GNB), logistic regression (LR), and random forest regressor (RFR) [20][21][22] were independently tested using cross-validation.To determine the predictive accuracy of developing overweight/obesity, 75% of the dataset was destined for training the model (training dataset).Once the classifiers were trained, their learning was tested with the remaining 25% of data (test dataset).The output obtained from prediction was compared to actual values of the dataset, obtaining successful percentage levels for each predictive model.
A cascade classifier flow was proposed.It was constituted by the three classifiers with the best results to predict overweight/obesity in the training phase.Overweight/obesity and healthy classification limit thresholds of 70 and 80%, respectively, were considered with the aim of obtaining the highest possible number of successfully classified samples, increasing precision (percentage of correct predictions) and decreasing the misclassification rate.As shown in Figure 1, the best classifier in training proceeds to evaluate the test dataset.The results are classified into two groups: First, the cases that are positively classified according to the established threshold; second, the cases in which the probability of classification does not reach this limit threshold are not classified by the first classifier.The second group was passed to the second classifier and the same process was repeated.The evaluation process was repeated until all classifiers were used or there were no more individuals to be classified.
variables are shown in the Supplementary Table S1.
In the inclusion study, all participants accepted and signed an informed consent form.The study was approved by the Regional Clinical Drugs Research Ethics Committee of the Community of Madrid (Comité Ético de la Investigación con Medicamentos Regional de la Comunidad de Madrid CEIm-R, Approval Code: 06/2018.Approval date: 28 June 2018) and conducted in accordance with the Declaration of Helsinki.This project is part of the GenObIA consortium of the Madrid Community (GenObIA-CM.B2017/BMD-3773).

Classical Machine Learning Algorithms and Predictive Model Based on Cascade Classifier Flow
The widely used nine classical machine learning algorithms AdaBoost (ADB), bagging classifier (BC), Bernoulli Naïve Bayes (BNB), decision tree and extra trees (DT and ETs), gradient boosting (GB), Gaussian Naïve Bayes (GNB), logistic regression (LR), and random forest regressor (RFR) [20][21][22] were independently tested using cross-validation.To determine the predictive accuracy of developing overweight/obesity, 75% of the dataset was destined for training the model (training dataset).Once the classifiers were trained, their learning was tested with the remaining 25% of data (test dataset).The output obtained from prediction was compared to actual values of the dataset, obtaining successful percentage levels for each predictive model.
A cascade classifier flow was proposed.It was constituted by the three classifiers with the best results to predict overweight/obesity in the training phase.Overweight/obesity and healthy classification limit thresholds of 70 and 80%, respectively, were considered with the aim of obtaining the highest possible number of successfully classified samples, increasing precision (percentage of correct predictions) and decreasing the misclassification rate.As shown in Figure 1, the best classifier in training proceeds to evaluate the test dataset.The results are classified into two groups: First, the cases that are positively classified according to the established threshold; second, the cases in which the probability of classification does not reach this limit threshold are not classified by the first classifier.The second group was passed to the second classifier and the same process was repeated.The evaluation process was repeated until all classifiers were used or there were no more individuals to be classified.

Performance Assessing Metrics of the Algorithms
Machine learning algorithms for classification are typically evaluated using simple methodologies that will be familiar to many medical researchers and clinicians.In the current study, accuracy, precision, recall, and F1-score evaluation metrics were used to test the performance of predictive algorithms.
Accuracy: measures the proportion of correct predictions from the total number of predictions.It is obtained as the number of correct predictions divided by the total number of predictions [23].Accuracy = (true positives + true negatives)/total predictions Precision: a metric that quantifies the accuracy of positive (overweight/obesity) and negative (normal weight) predictions [23].
Precision overweight/obesity = true positives/true positives + false positives (positive prediction value) Precision normal weight = true negatives/true negatives + false negatives (negative prediction value) Recall: an important metric used in classifications to evaluate the performance of a model.It measures the model's ability to correctly identify cases (overweight/obesity) and healthy (normal weight) subjects [23].
Recall overweight/obesity (sensitivity) = true positives/actual positives (true positives + false negatives) Recall normal weight (specificity) = true negatives/actual negatives (true negatives + false positives) F1-score: the harmonic mean of precision and recall.It provides a single metric that combines both precision and recall.It is calculated as 2 × (precision × recall)/(precision + recall).

Ranking of the Predictive Algorithm: Statistical Validation
One-hundred runs were launched to compare the predictive capacity of each classical machine learning algorithm and our proposal of the cascade classifier flow.A set of metrics variables, including accuracy (percentage of data correctly classified), misclassification rate (percentage of misclassified data), precision for each class (percentage of correct prediction), sensitivity or positive recall, and specificity or negative recall, was obtained.
In addition, a non-parametric statistical study based on the Friedman test was performed to detect significant differences between the behavior of two or more algorithms.The Friedman test was used as an analog of the two-way analysis of variance [24,25], but in this case, by range variance.The first step was to convert original predictive results into ranks for each algorithm/instance.Once the information was gathered, ranks were generated as follows: for each instance (i), the values were classified from 1 (best result) to k (worst result, this being the maximum number of algorithms), with each rank defined as: Therefore, the rank of the algorithm must be calculated based on the ranks obtained in each instance: The Friedman statistic F f [26] was computed as which was distributed according to an X 2 distribution with k − 1 degrees of freedom.The null hypothesis (H0) considered that all predictive models were equal, being plausible to look at the critical value according to the distribution of X 2 with 9 degrees of freedom and an α value of 0.05.

Predictive Variables with a Greater Impact on Overweight/Obesity Risk: SHAP Tool
The shapely additive explanation (SHAP) technique was used to determine the impact of the variables on weight gain.SHAP is a theoretic approach for explaining the output of any machine learning model, providing a unified framework that supports various interpretations based on the contribution of each input variable in the model system.SHAP is widely used in the quest for the interpretability and explainability of predictive machine learning models [27][28][29].This tool has the ability to identify the priority of the contributions of all features from a global perspective, providing a visual and comprehensive approach to increase the transparency of ensemble models, which helps with interpreting and understanding the entire model and with visualizing feature attributions at the observation level for any machine learning model [30].

Description of Recruited Population
Data from 1179 subjects were recorded to develop predictive models using classical machine learning techniques separately and the cascade classifier flow.The study population showed a balanced distribution between men (48.3%) and women (51.7%), with an average age of 41.21 ± 0.58 years, in the range of 18-69 years.It was observed that 41.8% (567 subjects) was overweight/obese, which supported a sample of a large enough size for the learning of the predictive algorithms used.Detailed distributions of additional variables and categories used as inputs are shown in Supplementary Table S1.

Cross-Validation of Classical Machine Learning Algorithms
A 10 k-fold cross-validation was performed on the nine classical machine learning models.Table 1 shows the precision and deviation obtained after the cross-validation test for each predictive model.The results reveal that the five predictive models, bagging, logistic regression, gradient boosting, extra trees, and random forest, show the highest accuracy values, ranging from 0.69 to 0.72 (Table 1).

Results of the Cascade Classifier Model
Different combinations among classical predictive algorithms were carried out with the aim of creating the best cascade classifier model.It is important to note that weight, height, and body mass index were not included as variables when developing a predictive model.Finally, the three classical models, gradient boosting, random forest, and logistic regression, constituted the cascade classifier.The combination of the above-described classical machine learning algorithms reported the highest accuracy in the test phase compared to the rest of the combinations (80%).
-Gradient boosting was used as the first-level classifier.This model focused on performing the largest individual classification between the high risk of overweight/obesity or normal weight groups.In this case, an accuracy of 80% was obtained out of a total of 135/295 classified individuals.The false-negative value was low (18) Table 2 shows the precision level, numbers of classified and unclassified individuals, and the confusion matrix for predicting both classes (normal weight and overweight/obesity) of the proposed cascade classifier model.Initially, all recruited variables (38) were considered in the cascade flow model, obtaining an accuracy of 80% and successfully classifying 65.5% of the total number of tested individuals (Table 2).The precision and recall variables for both classes are around 80%, suggesting that the numbers of false negatives and positives are practically null.In addition, we decided to perform additional tests by eliminating several variables to determine how they might affect the predictive ability of the cascade model.In this regard, age and recruitment center variables were removed from the predictive model, generating two alternative instances with 37 variables.The age variable was removed since it is a continuous non-modifiable variable that is closely related to overweight/obesity.In this line of reasoning, it would be plausible to think that the university recruitment center provided the majority of data from young people, which could be considered to introduce a certain level of bias.For this reason, we also decided to eliminate this variable, using a model with 37 variables without a recruitment center (37c).The results obtained with 37 variables without age (37a) or without a recruitment center (37c) achieved a classification rate close to the value obtained with 38 variables (instance 38) (Table 2).However, the predictive model based on 38 variables not only achieved the highest value of a correct classification rate and total number of classified subjects, but also the lowest number of unclassified numbers (Table 2).

Comparison of Effectiveness between Classical Machine Learning Algorithms and Cascade Classifier for Predicting Overweight/Obesity
Different metrics variables were measured to compare the predictive capacity of the cascade classifier with respect to the rest of the classical machine learning algorithms.Table 3 shows the variables related to the accuracy, precision, and recall of predictions.The results reveal that the cascade classifier obtained the best results for all variables compared to the classical predictive models, with almost 80% of the data being correctly classified and the highest values of precision and recalls with a very low false-positive rate.These results show that the cascade flow model is the most effective model for predicting overweight/obesity, showing the highest values of accuracy as well as precision and recall for both normal-weight and overweight/obesity groups (Table 3).In order to eliminate bias due to age or recruitment center, we tested the ability to predict the overweight/obesity of the cascade classifier using a dataset with only 36 variables (without age or a recruitment center), revealing the cascade flow model was also the most effective model for predicting overweight/obesity (Supplementary Table S2).This suggests the robustness of the proposed model.Table 4 shows the rankings for each algorithm/instance.The results reveal that the cascade classifier achieved the top-ranking position in all instances, followed by the gradient boosting and random forest models.The cascade classifier achieved a statistically significantly better ranking compared to the rest of the predictive models tested.In addition, Figure 2A represents the probability of being the best method, denoted as the probability of winning, and its standard deviation for the results obtained with accuracy as the objective function.The cascade model had the highest probability of winning, with the lowest deviation compared to the rest of the models and without competing models in the same space.It was also supported by the ranking of models and represented by a density plot as a function of the accuracy obtained by the models in all their versions (Figure 2B).As shown, the cascade model concentrates most of the results around 79% accuracy, while the rest of the models presented 70% or lower (Figure 2B).All the results show that the cascade classifier is the best classifier model for predicting overweight/obesity among all the models tested.

Variables with the Greatest Impact on Overweight/Obesity Predictions: Interpretation of Personalized Prediction
Figure 3A shows the feature importance plot based on the cascade flow model.The model´s SHAP interpretation revealed that age was the variable with the greatest impact on predicting overweight/obesity (Figure 3A).Other variables, such as sex, education level, profession, and aspects related to smoking and alcohol consumption; several disorders, including apnea and metabolism syndrome; Mediterranean diet adherence; and physical activity, were important predictive factors for gaining weight, with the MDI ranging from 0.05 to 0.18.
Figure 3B represents the SHAP summary plot of the cascade flow model.Each row in the plot represents a feature, with the corresponding SHAP values displayed along the x-axis.The features are ranked according to their average absolute SHAP values, which represent the most important features of the model.A dot is created for each feature attribution value for the profile of each patient, and thus, one patient is allocated one dot on the line for each feature.The color indicates the magnitude of the feature value, where red denotes larger values and blue denotes smaller values.Age is a highly important feature of the model.Individuals of an older age are associated with higher red-dot values, with corresponding SHAP values greater than zero indicating a positive impact on overweight/obesity classifications.Conversely, as the feature value decreases, the SHAP value is less than zero, indicating a negative impact.In addition, the distribution of points also provides important information.The dispersion of samples in the plot for the age, sex, and education level features suggests a greater influence of these features on the model.Conversely, for the stress or earning features, most points are concentrated around SHAP = 0, indicating that these features only affect a small subset of individuals.For diseases such as sleep apnea and metabolic syndrome, as well as weekly consumption of spiritual

Variables with the Greatest Impact on Overweight/Obesity Predictions: Interpretation of Personalized Prediction
Figure 3A shows the feature importance plot based on the cascade flow model.The model s SHAP interpretation revealed that age was the variable with the greatest impact on predicting overweight/obesity (Figure 3A).Other variables, such as sex, education level, profession, and aspects related to smoking and alcohol consumption; several disorders, including apnea and metabolism syndrome; Mediterranean diet adherence; and physical activity, were important predictive factors for gaining weight, with the MDI ranging from 0.05 to 0.18.
behavior of the sex variable seems to play a bimodal role closely related to age, with the highest risk of obesity in women occurring in old age and in men in middle age.Taking all the data together, it may be considered that the profile with the highest risk of overweight/obesity would be constituted by females older than 50 years, with low educational and economic levels, ex-smokers or non-smokers, a low adherence to the Mediterranean diet, weekly beer and/or wine consumption, sedentary lifestyle, and diagnosed with chronic disorders, such as apnea or/and metabolism syndrome (Figure 3B).  Figure 3B represents the SHAP summary plot of the cascade flow model.Each row in the plot represents a feature, with the corresponding SHAP values displayed along the x-axis.The features are ranked according to their average absolute SHAP values, which represent the most important features of the model.A dot is created for each feature attribution value for the profile of each patient, and thus, one patient is allocated one dot on the line for each feature.The color indicates the magnitude of the feature value, where red denotes larger values and blue denotes smaller values.Age is a highly important feature of the model.Individuals of an older age are associated with higher red-dot values, with corresponding SHAP values greater than zero indicating a positive impact on overweight/obesity classifications.Conversely, as the feature value decreases, the SHAP value is less than zero, indicating a negative impact.In addition, the distribution of points also provides important information.The dispersion of samples in the plot for the age, sex, and education level features suggests a greater influence of these features on the model.Conversely, for the stress or earning features, most points are concentrated around SHAP = 0, indicating that these features only affect a small subset of individuals.For diseases such as sleep apnea and metabolic syndrome, as well as weekly consumption of spiritual drinks, we observed a dense cluster of instances with blue points with smaller, negative SHAP values.Instances with red points further extend toward the right, indicating that the positive impact of sleep apnea, metabolic syndrome, and spiritual drink consumption on overweight/obesity is greater than the negative impact.This suggests that patients older than 50 years are at a higher risk of gaining weight.It is important to remark that, due to the dispersion values of SHAP values for each sex, it should be interpreted that the behavior of the sex variable seems to play a bimodal role closely related to age, with the highest risk of obesity in women occurring in old age and in men in middle age.Taking all the data together, it may be considered that the profile with the highest risk of overweight/obesity would be constituted by females older than 50 years, with low educational and economic levels, ex-smokers or non-smokers, a low adherence to the Mediterranean diet, weekly beer and/or wine consumption, sedentary lifestyle, and diagnosed with chronic disorders, such as apnea or/and metabolism syndrome (Figure 3B).
On the other hand, a typical example is provided to illustrate the interpretability of the model: a 60-year-old-male ex-smoker who had been diagnosed with sleep apnea and diabetes (Figure 3C).The arrows show the influence of each factor on prediction.The SHAP value for each characteristic is displayed as a force to increase or decrease the evaluation, and every prediction began with the base value (−0.135), which was the average SHAP value of all predictions.The blue and red arrows indicate whether the factor reduced (blue) or increased (red) the risk of overweight/obesity.The combined effects of all factors provided the final SHAP value.As is shown in Figure 3C, the SHAP value of this subject is 3.43, which is larger than the base value (−0.135), indicating a high risk of gaining weight.Among all factors, a positive (red) apnea diagnosis and being an ex-smoker, with +1.47 and +0.88, respectively, had a great contribution to the assessment of the overweight/obesity risk in the analyzed subject.

Discussion
In the present study, an interpretable innovative classifier model based on a three-stage classification model was constructed.The performed classifier, through evaluating different modifiable lifestyle variables and non-modifiable biological factors, showed a favorable predictive capability with high accuracy to classify people at risk of overweight/obesity among subjects aged 18 years or older in the community of Madrid, Spain.
Several techniques have been created with the aim of building predictive and prognostic models for different disorders, including obesity.In the last decade, machine learning algorithms have received special interest due to their promising potential in obesity research, being considered classifier models with supervised learning phases as the best option to achieve impressive high predictive accuracy [31][32][33][34][35]. Interestingly, Yi et al. analyzed the suggested superiority of deep learning for obesity predictions over traditional machine learning methods [36].However, it is important to note that a deep learning requires much larger datasets than traditional machine learning to achieve an optimal performance.In addition, training deep learning models can be computationally intensive and requires significant resources, such as powerful processing units that are not available in healthcare or nutritional practices.On the other hand, traditional machine learning can work effectively with smaller datasets and can be less demanding in terms of computational resources.In addition, deep learning, due to its hierarchical structure and ability to learn complex features, can be less interpretable compared to traditional machine learning.This means that deep learning models can provide accurate predictions, but it is not always easy to understand how they arrived at those conclusions.On the other hand, traditional machine learning models are often more interpretable and offer a better ability to explain their results.At present, a large number of studies have presented different machine learning approaches to predict obesity [37].However, these studies are very heterogeneous with respect to machine learning techniques, risk factors, and populations tested.This heterogeneity makes it difficult to perform a comparison among them.For example, Singh and Tawfik analyzed numerous multivariate regression algorithms on a dataset obtained from a millennium cohort and acquired over 93.4% accuracy to predict teenage BMIs [38].Uçar et al. estimated individual percentages of body fat using hybrid machine learning algorithms, such as the support vector machine regression model and decision tree regression, using 13 anthropometric measurements [39], while Zheng et al. used binary logistic regression, improved decision tree, and even artificial neural network models on nine health-related behaviors to predict obesity in high-school students, obtaining accuracy levels ranging between 80.23 and 84.22%, depending on the technique used [40].However, most studies seem to have in common the use of different predictive techniques independently, without analyzing combined models, and with a limited number of inputs in the dataset.In the present study, a classifier model was developed based on the combination of three supervised machine learning algorithms using 38 different inputs associated with lifestyle, sociodemographic, and health status variables, which allowed for an accuracy of 79% for predicting overweight/obesity.Interestingly, the proposed classifier model achieved the highest value of accuracy when it was compared to nine classical machine learning methods separately, whose accuracy results ranged from 63 to 73%.In addition, it was also demonstrated that there were significant differences in metric variables, such as precision and recall, between classical algorithms separately and the combined predictive model, showing the higher predictive ability of the combined model.Our findings suggest that the successful implementation and evaluation of the combined model might offer valuable insights into the development of more robust and accurate machine learning systems for addressing overweight/obesity-related challenges.In this line of evidence, recent studies also reported that combining different machine learning algorithms succeeded in predicting obesity with higher accuracy values than individual models separately [37].Surprisingly, other studies have obtained exceptionally high accuracy values, ranging from 89.0% to 97.2% [41,42].However, it is important to remark that they may have achieved such good results due to the inclusion of height and weight as inputs for their combined models [41,42].Even other studies include a very limited number of inputs, which also included height and weight.In this regard, Jindal et al. employed an ensemble machine learning approach for predicting obesity based on four main determinants (age, height, weight, and BMI), obtaining average predicted values very close to 90% [43].In contrast, weight and height variables were not included as inputs in the training process of the predictive model proposed in the present work, since both variables define the subject s body mass index and, therefore, the predictive model would recognize these cases.The non-inclusion of weight and height affects the accuracy; however, it supports the higher robustness of the predictive model.
In general, the machine learning approach has become a powerful tool that leads to a better understanding of multifactorial disorders, such as obesity [44].In this regard, ma-chine learning has been shown to have the ability to identify factors with a higher impact on obesity and even the most significant interactions among those risk factors for predicting obesity [45].In accordance with other studies, our results reveal that age and sex have the greatest impact on overweight/obesity [7,46].It is widely known that aging is closely associated with an increase in abdominal white adipose tissue and fat deposition in skeletal muscle [47][48][49].However, according to the predictive model proposed, the behavior of the sex variable seems to play a bimodal role closely related to age, with the highest risk of obesity in women occurring in old age and in men in middle age.At least, in part, this differential behavior may be explained by biological factors or hormonal changes associated with different stages of life.Indeed, in females, menopause directly affects fat distribution and deposition, increasing the risk of overweight and obesity [50,51].It suggests that the cascade flow algorithm may have the ability to present the physiological aspects related to sex and age and is closely involved in weight gain.
The present study also determined a considerable impact on two variables related to health status, reporting that sleep apnea and metabolic syndrome diagnoses may act as obesity predictors.Similar findings have been previously described in other studies [52,53].However, honestly, it would be more plausible to consider that obesity is the main cause of sleep apnea and metabolic syndrome.However, it is important to point out that other aspects of the above-mentioned disorders may promote higher obesity.In this regard, one of the underlying mechanisms of metabolic syndrome is insulin resistance, which is widely accepted to promote hyperglycemia and higher abdominal adiposity [54,55].On the other hand, alterations in the sleep cycle due to sleep apnea induce important neuroendocrine and metabolic modifications strongly associated with obesity [56][57][58][59].Interestingly, in the present study, it has been also identified with sleep less than 8 h as a predictor for weight gain.
A large number of studies have established a close relationship between lifestyle habits and overweight/obesity, paying special attention to dietary patterns and physical exercise [60,61].Consequently, our results demonstrate that nutritional habits and physical activity as well as toxic habits have a great impact on overweight/obesity classification.In this regard, it was observed that an adherence to the Mediterranean diet and vigorous or medium physical activity were negative predictors for overweight/obesity.These findings are supported by previous studies using conventional statistical analysis techniques and machine learning techniques [62,63].On the other hand, the proposed model in the present study revealed that toxic habits also seem to play an important role in predicting overweight/obesity.In this regard, there was a directly proportional relationship between the probability of becoming overweight and being an ex-smoker.Interestingly, epidemiologic studies have reported that, on average, smokers tend to weigh less than non-smokers.The majority of quitters gain about 3-9 kg within 8 years of quitting, and between 10% and 13% of quitters gain at least 11 kg [64][65][66][67].With respect to alcoholic drinks consumption, several studies have reported that alcohol consumption does not necessarily lead to weight gain [68,69], a reduction in the risk of overweight/obesity being reported among moderate alcohol consumers compared to non-drinkers, showing that the beneficial effect of drinking on obesity is present when alcohol is consumed in low-moderate amounts on a regular basis [69,70].Consistent with these findings, the moderate and low consumption of beer and/or wine were used by the cascade flow model as negative predictors for developing overweight/obesity.
Additionally, in accordance with previous studies, several sociodemographic factors, such as academic level, profession, and even economic status, have an importance effect on the risk of being overweight or obese [71,72].However, the effects of sociodemographic factors on overweight and obesity risk are paradoxical, with controversial results in the scientific literature [73,74].At least, in part, this may be due to several sociodemographic variables that seem to be related to and even conditioned by other predictive variables of weight gain.In this regard, type of profession exerts an important influence on the level of physical activity [75], which is one of the most powerful predictors of obesity, as discussed above.It highlights the need to create predictive models that allow us to assess not only the impact of each variable on weight gain, but also the effect of the relationship among different variables on overweight/obesity risk.Accordingly, different authors have concluded that classifier models using machine learning techniques could be used to develop individualized predictions based on specific individual features and interactions among subject features, while logistic regression models should be only applied at the population level [76,77].In the present study, the interpretation of the SHAP value was used to combine the predictive model to help better understand the decision-making process.The SHAP value assesses the significance of the output by considering all possible feature combinations and provides consistent and locally precise attribute values for each feature in the prediction model.In summary, considering the key risk factors, the model can intuitively explain to clinicians which specific characteristics of patients predispose them to a higher or lower risk of developing overweight/obesity.Our interpretable classifier model has the potential to find the most specific features involved in obesity for each subject and, therefore, to personalize prevention strategies, rendering it a valuable tool in clinical practice.

Figure 2 .
Figure 2. Bayesian ACC and density ACC using instances.Probability of wining for each classical machine learning technique separately and the cascade model.Panel (A): Results represented as Bayesian average coverage criterion.Panel (B): Results represented as density average coverage criterion.

Figure 2 .
Figure 2. Bayesian ACC and density ACC using instances.Probability of wining for each classical machine learning technique separately and the cascade model.Panel (A): Results represented as Bayesian average coverage criterion.Panel (B): Results represented as density average coverage criterion.

Figure 3 .Figure 3 .
Figure 3. SHAP values.The model´s interpretation.Panel (A): Feature importance plot (after feature normalization).Panel (B): SHAP summary plots of the cascade flow model.Each row in the SHAP summary plot represents a feature, with the corresponding Shap values displayed along the x-axis.The features are ranked according to their average absolute Shap values, which represent the most Figure 3. SHAP values.The model s interpretation.Panel (A): Feature importance plot (after feature normalization).Panel (B): SHAP summary plots of the cascade flow model.Each row in the SHAP summary plot represents a feature, with the corresponding Shap values displayed along the x-axis.The features are ranked according to their average absolute Shap values, which represent the most important features of the model.Each point in the plot corresponds to a sample, with the color indicating the magnitude of the feature value, where red denotes larger values and blue denotes smaller values.Panel (C): Waterfall plot for explaining an individual s prediction results in the validation cohort.The y axis shows the name of the variables and the x axis shows the Shap value.The red bar shows the positive contribution of the feature to the predicted value, and the blue bar shows the negative contribution of the feature to the predicted value.

Table 1 .
Cross-validation results for the study population.
, indicating that the recall of the overweight/obese class was 89% since there were hardly any cases of individuals suffering from overweight/obesity.Unclassified subjects were passed to the classification model of the following level.-Random forest was used as the second-level classifier.The number of classified individuals was smaller than gradient boosting since the input data of this model were unclassified individuals by gradient boosting.The level of difficulty of classification increases as the cascade classifier progresses.However, 34 individuals out of the 160 received were successfully classified.The results of the confusion matrix are quite good since the false-negative value was still low (3), with a recall of almost 70%.-Logistic regression was used as the third-level classifier.This classifier classified the fewest individuals, since their factors did not clearly express to the model any type of classification within the established levels.The results reveal that the other 24 individuals were successfully classified with an accuracy of 83% and an excellent positive recall of 93%, since only one false negative was obtained.This means that, of the 15 overweight cases that had entered this model, only one of them was wrongly classified as non-overweight.

Table 2 .
Results of metric variables for the cascade classifier model.

Table 3 .
Results after 100 runs of each algorithm for each of the instances.

Table 4 .
Ranks for each algorithm/instance.

Table 4 .
Ranks for each algorithm/instance.